LC_EVENT_CCMD Home

LiteCAD generates LC_EVENT_CCMD event when execures custom command.

The following properties are used for this event type:

Property Description
LC_PROP_EVENT_TYPE Value LC_EVENT_CCMD
LC_PROP_EVENT_MODE Mode (see below)
LC_PROP_EVENT_WND Handle to a graphics window
LC_PROP_EVENT_HCMD Handle to the command
LC_PROP_EVENT_INT1 Identifier of the command


LC_PROP_EVENT_MODE variants:

LC_PROP_EVENT_MODE Description Additional properties
LC_CCMD_CREATE Command has been created
LC_CCMD_DESTROY Command will be destroyed
LC_CCMD_START User starts the command.

On this event LiteCAD will analyse return code.
The return code means:
0 - finish the command;
1 - wait for user actions
LC_PROP_EVENT_INT2 - command parameter,
  passed from lcWndExeCommand function (CmdParam).
LC_CCMD_FINISH Command finish
LC_CCMD_LBDOWN Mouse left button has been pressed LC_PROP_EVENT_INT2 - cursor X (window pixels),
LC_PROP_EVENT_INT3 - cursor Y (window pixels),
LC_PROP_EVENT_INT4 - <Shift> key state (0/1),
LC_PROP_EVENT_INT5 - <Ctrl> key state (0/1),
LC_PROP_EVENT_FLOAT1 - cursor X (drawing units),
LC_PROP_EVENT_FLOAT2 - cursor Y (drawing units)
LC_CCMD_LBUP Mouse left button has been released LC_PROP_EVENT_INT2 - cursor X (window pixels),
LC_PROP_EVENT_INT3 - cursor Y (window pixels),
LC_PROP_EVENT_INT4 - <Shift> key state (0/1),
LC_PROP_EVENT_INT5 - <Ctrl> key state (0/1),
LC_PROP_EVENT_FLOAT1 - cursor X (drawing units),
LC_PROP_EVENT_FLOAT2 - cursor Y (drawing units)
LC_CCMD_RBDOWN Mouse right button has been pressed LC_PROP_EVENT_INT2 - cursor X (window pixels),
LC_PROP_EVENT_INT3 - cursor Y (window pixels),
LC_PROP_EVENT_INT4 - <Shift> key state (0/1),
LC_PROP_EVENT_INT5 - <Ctrl> key state (0/1),
LC_PROP_EVENT_FLOAT1 - cursor X (drawing units),
LC_PROP_EVENT_FLOAT2 - cursor Y (drawing units)
LC_CCMD_RBUP Mouse right button has been released LC_PROP_EVENT_INT2 - cursor X (window pixels),
LC_PROP_EVENT_INT3 - cursor Y (window pixels),
LC_PROP_EVENT_INT4 - <Shift> key state (0/1),
LC_PROP_EVENT_INT5 - <Ctrl> key state (0/1),
LC_PROP_EVENT_FLOAT1 - cursor X (drawing units),
LC_PROP_EVENT_FLOAT2 - cursor Y (drawing units)
LC_CCMD_MOUSEMOVE Mouse position has been changed LC_PROP_EVENT_INT2 - cursor X (window pixels),
LC_PROP_EVENT_INT3 - cursor Y (window pixels),
LC_PROP_EVENT_INT4 - <Shift> key state (0/1),
LC_PROP_EVENT_INT5 - <Ctrl> key state (0/1),
LC_PROP_EVENT_INT6 - cursor color ( COLORREF ),
LC_PROP_EVENT_FLOAT1 - cursor X (drawing units),
LC_PROP_EVENT_FLOAT2 - cursor Y (drawing units)
LC_CCMD_PAINT Redraw window during command execution LC_PROP_EVENT_HDC - device context,
LC_PROP_EVENT_INT6 - cursor color ( COLORREF )
LC_CCMD_SNAP Object snap LC_PROP_EVENT_INT2 - "on mouse LB click" flag,
LC_PROP_EVENT_FLOAT1 - cursor X (drawing units),
LC_PROP_EVENT_FLOAT2 - cursor Y (drawing units),
LC_PROP_EVENT_FLOAT3 - snap distance,
  In order LiteCAD snap cursor position (like magnet), you have to set the following properties:
LC_PROP_EVENT_FLOAT1 - new cursor position X (drawing units),
LC_PROP_EVENT_FLOAT2 - new cursor position Y (drawing units),
  and call lcEventReturnCode function with non-zero value.


See also

  Code sample